# Maintainer: Caleb Connolly <caleb@connolly.tech>
pkgname=qbootctl
pkgver=0.1.2
pkgrel=1
pkgdesc="Tool for interacting with Android A/B slots"
url="https://gitlab.com/sdm845-mainline/qbootctl"
# Only really useful on Qualcomm A/B Android devices
arch="all"
license="GPL-3.0-or-later"
subpackages="$pkgname-openrc"
makedepends="
	linux-headers
	meson
	zlib-dev
"
source="$pkgname-$pkgver.tar.gz::https://gitlab.com/sdm845-mainline/qbootctl/-/archive/$pkgver/qbootctl-$pkgver.tar.gz
	qbootctl-openrc.initd
	include-cstdint.patch
"
options="!check" # no testsuite

build() {
	abuild-meson . output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	install -Dm755 "$srcdir/$pkgname-openrc.initd" "$pkgdir/etc/init.d/$pkgname"
}

sha512sums="
5606296b48c366effd0379a64cd40b84e4d4ea4d1e7e20946afd6a72afac58423fa4f6c5637afb4a90aa5b5d50fe14c489dc6d57b1cc990e97a916f5bbcfc4b7  qbootctl-0.1.2.tar.gz
da586749da1dd63e19f2bbc361b8c6689a713f4ea9d46d5f299c574ceda14aedad6c6f0fb5849c88cc99904a38a7318456a21417d212c147dd9d367752676a1e  qbootctl-openrc.initd
807e79afbfb6266aba52172359c771cfe480ee7f3c85f3971b74fe4417295faa26993b790e5476c5b9430d973b1a3caade932f2755002a04d584ccafc49c8857  include-cstdint.patch
"
